import { LazyLoad } from '@/library/widgets'
import type { IRoutesItem } from '@/router/baseType'
import { authenticationPaths } from './paths'

const AuthenticationIndex = LazyLoad('authentication')
const AuthenticationHome = LazyLoad('authentication/home')
const AuthenticationLogin = LazyLoad('authentication/login')
const AuthenticationRegister = LazyLoad('authentication/register')

export const AuthenticationRoutes: IRoutesItem = {
  path: authenticationPaths.basePagePath,
  component: AuthenticationIndex,
  openDefaultIndex: true,
  children: [
    {
      path: authenticationPaths.home,
      component: AuthenticationHome,
    },
    {
      path: authenticationPaths.login,
      component: AuthenticationLogin,
    },
    {
      path: authenticationPaths.register,
      component: AuthenticationRegister,
    },
  ],
}
